package com.yhy.wxzn.common.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.Optional;
import java.util.stream.Stream;

/**
 * @Auther: 97354
 * @Date: 2023/11/1 16:27
 * @Description: WmsMsgStatusEnums
 * @Version 1.0.0
 */
@Getter
@AllArgsConstructor
public enum WmsMsgTypeEnums {
    MSG0(0,"刷新ASN状态", "wmsAsnDetailServiceImpl","refreshAsnStatus"),
    MSG1(1,"ASN分配", "wmsAsnServiceImpl","allocateBatch"),
    MSG2(2,"ASN分发", "wmsAsnServiceImpl","dispatchBatch"),
    MSG3(3,"Wcs扫码处理", "WmsBusinessMsgServiceImpl","doContainerBind"),
    /**
     * 输送线任务下发时触发逻辑
     * */
    MSG4(4,"输送线任务完成逻辑-入库口", "WmsBusinessMsgServiceImpl","dispatchTransmission"),
    /**
     * 已经确定提升机在1楼并且是空闲状态，单车情景，提升机和小车在相同楼层
     * 此时只需要调度小车到提升机接驳点
     * */
    MSG5(5,"输送线任务完成逻辑-调度小车", "WmsBusinessMsgServiceImpl","dispatchFourWayCarByLine"),
    /**
     * 此时处理提升机不在1楼需调度小车跨层到1楼取货的场景
     * */
    MSG6(6,"生成提升机跨层任务-调度小车", "WmsBusinessMsgServiceImpl","dispatchFourWayCarByElv"),
    ;

    private int code;
    private String description;
    private String serviceName;
    private String methodName;

    public static Optional<WmsMsgTypeEnums> parse(int code){
        return Stream.of(WmsMsgTypeEnums.values()).filter(e->e.getCode()==code).findFirst();
    }
}
